using System;
using System.Data;
using System.Data.SqlClient;
using PPIProxy.PPIWebservice;

namespace PPIProxy
{
    public static class WUtility_Asset_XMissionStructure
    {
        #region Query

        public static DataSet SelectAllIdName(string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Utility_Asset_XMissionStructure_SelectAllIdName(connectionKey);
        }

        public static DataSet SelectUtilityNearVendor(Int32 vendorID, Int32 maxDistance, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Utility_Asset_XMissionStructure_SelectUtilityNearVendor(vendorID, maxDistance, connectionKey);
        }

        public static DataSet SelectAllServer(string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Utility_Asset_XMissionStructure_SelectAllServer(connectionKey);
        }

        public static DataSet SelectAllServer(int utilityID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Utility_Asset_XMissionStructure_SelectAllServerByUtilty(utilityID, connectionKey);
        }

        public static DataSet SelectAllByQueryAsset(int queryAssetID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Utility_Asset_XMissionStructure_SelectAllByQueryAsset(queryAssetID, connectionKey);
        }

        #endregion Query

        #region CRUD

        public static void NewByVendor(int vendorId, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Utility_Asset_XMissionStructure_CreateNewByVendor(vendorId, connectionKey);
        }

        public static void Update(Int32 structureID, Int32 projectID, Int32 XMissionStructures_TopTypeID,
                                  double Latitude, double Logitude, double Alititude, Int32 SatelliteCount,
                                  DateTime SatelliteTime, bool SolutionAvaible, int Handheld, Int32 contactID,
                                  DateTime date, int countImages, int utilityFK, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Utility_Asset_XMissionStructure_Update(structureID,projectID,XMissionStructures_TopTypeID,Latitude,Logitude,Alititude,SatelliteCount,SatelliteTime,SolutionAvaible,Handheld,contactID,date,countImages,utilityFK,connectionKey);
        }

        public static void Delete(int utilityId, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Utility_Asset_XMissionStructure_Delete(utilityId,connectionKey);
        }

        #endregion CRUD
    }
}